<%@include file="/page/tag.jsp"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
<!--框架必需start-->
<script type="text/javascript" src="${ctp}/QUI/libs/js/jquery.js"></script>
<script type="text/javascript" src="${ctp}/QUI/libs/js/language/cn.js"></script>
<script type="text/javascript" src="${ctp}/QUI/libs/js/framework.js"></script>
<link href="${ctp}/QUI/libs/css/import_basic.css" rel="stylesheet"	type="text/css" />
<link href="${ctp}/QUI/libs/skins/lightBlue/style.css" rel="stylesheet" type="text/css" id="theme" themeColor="deepBlue"/>

<!-- 表单验证start -->
<script src="${ctp}/QUI/libs/js/form/validationRule.js" type="text/javascript"></script>
<script src="${ctp}/QUI/libs/js/form/validation.js" type="text/javascript"></script>
<!-- 表单验证end -->

<!-- 树组件start -->
<script type="text/javascript" src="${ctp}/QUI/libs/js/tree/ztree/ztree.js"></script>
<link type="text/css" rel="stylesheet" href="${ctp}/QUI/libs/js/tree/ztree/ztree.css"></link>
<!-- 树组件end -->

<!-- 树形下拉框start -->
<script type="text/javascript" src="${ctp}/QUI/libs/js/form/selectTree.js"></script>
<!-- 树形下拉框end -->


<!--框架必需end-->
</head>
<body>

	<form id="ff" target="frmright" class="padding_top10" method="post" action="" failAlert="验证未通过">
		<input type="hidden" name="sysStateId"  value="<c:out value="${sysState.sysStateId }"/>"/>
		
		<table class="tableStyle" formMode="line">
		
			<c:choose>
				<c:when test="${!empty param.tableName }">
					<input type="hidden" name="tableName"  class="validate[required]" value="<c:out value="${sysState.tableName }"  default="${param.tableName }"/>"/>
					<input type="hidden" name="tableColumn"  class="validate[required]" value="<c:out value="${sysState.tableColumn }"  default="${param.tableColumn }"/>"/>
				</c:when>
				<c:otherwise>
					<tr>
						<td>表名：</td>
						<td><input type="text" name="tableName"  class="validate[required]" value="<c:out value="${sysState.tableName }"/>"/></td>
					</tr>
					
					<tr>
						<td>字段名：</td>
						<td><input type="text" name="tableColumn"  class="validate[required]" value="<c:out value="${sysState.tableColumn }"/>"/></td>
					</tr>
				</c:otherwise>
			</c:choose>
			
			<tr>
				<td>值：</td>
				<td><input type="text" name="tableKey"  class="validate[required]" value="<c:out value="${sysState.tableKey }"/>"/></td>
			</tr>
			
			<tr>
				<td>描述：</td>
				<td><input type="text" name="tableValue"  class="validate[required]" value="<c:out value="${sysState.tableValue }"/>"/></td>
			</tr>
			
			<tr>
				<td>排序：</td>
				<td><input type="text" name="sortIndex"  class="validate[required]" value="<c:out value="${sysState.sortIndex }" default="1"/>"/></td>
			</tr>
			
			<%-- <tr>
				<td>状态：</td>
				<td>
					<select name="state">
						
						<c:choose>
							<c:when test="${sysState.state ==  StateValue.Disable_key}">
								<option value="${StateValue.Disable_key }" selected="selected">${StateValue.Disable_value }</option>
								<option value="${StateValue.Enable_key }" >${StateValue.Enable_value }</option>
							</c:when>
							<c:otherwise>
								<option value="${StateValue.Enable_key }" selected="selected">${StateValue.Enable_value }</option>
								<option value="${StateValue.Disable_key }" >${StateValue.Disable_value }</option>
							</c:otherwise>
						</c:choose>
						
					</select>
				</td>
			</tr> --%>
			
			<tr>
				<td colspan="2">
					<input type="button" value="提交" onclick="submitF()" />
				 	<input type="reset" value="取消" onclick="closeWin()" />
				 </td>
			</tr>
			
		</table>
	</form>
	<script>
		function closeWin() {
			top.Dialog.close();
		}
		
		function submitF() {
			if($("#ff").validationEngine({returnIsValid: true})){
			 	$.ajax({
					url : "${ctp}/sysState/sysState_edit.do",
					type : "post",
					data : $("#ff").serialize(),
					success : function(data) {
						var popBox = new top.Dialog({
							Width:300,
	       					Height:110
						});
						if (data.result) {
							popBox.Title = data.msg;
							popBox.InnerHtml = '<table height="100%" border="0" align="center" cellpadding="10" cellspacing="0">\
										<tr><td align="right"><input type="button" id="Icon_' + this.ID + '" class="icon_alert" align="absmiddle"></td>\
											<td align="left" id="Message_' + this.ID + '" style="font-size:' + (popBox.defaultFontSize) + 'px;font-family:' + (popBox.defaultFontFamily) + '">' + data.msg + '</td></tr>\
									</table>';
							popBox.ShowCloseButton = false;
							popBox.ShowCancelButton = false;
							
							popBox.OKEvent = function() {
								popBox.close();
								top.frmright.reflushList();
								top.Dialog.close();
							};
							popBox.show();
							popBox.okButton.parentNode.style.textAlign = "center";
						} else {
							top.Dialog.alert("操作失败! " + data.msg, null, null, null, 2);
						};
					}
				});
			 };
		}
	</script>
</body>
</html>

